Java Database Programming with JDBC Java Database Programming with JDBC
by Pratik Patel
Coriolis, The Coriolis Group
ISBN: 1576100561   Pub Date: 10/01/96
  

Previous Table of Contents Next


Table 5.3 DatabaseMetaData ODBC calls.
JDBC Interface
Method
ODBC Call Comments
allProceduresAreCallable SQLGetInfo fInfoType = SQL_ACCESSABLE_
PROCEDURES
allTablesAreSelectable SQLGetInfo fInfoType = SQL_ACCESSABLE_
TABLES
getUserName SQLGetInfo fInfoType = SQL_USER_NAME
isReadOnly SQLGetInfo fInfoType = SQL_DATA_
SOURCE_READ_ONLY
nullsAreSortedHigh SQLGetInfo fInfoType = SQL_NULL_COLLATION; result must be SQL_NC_HIGH
nullsAreSortedLow SQLGetInfo fInfoType = SQL_NULL_COLLATION; result must be SQL_NC_LOW
nullsAreSortedAtStart SQLGetInfo fInfoType = SQL_NULL_COLLATION; result must be SQL_NC_START
nullsAreSortedAtEnd SQLGetInfo fInfoType = SQL_NULL_COLLATION; result must be SQL_NC_END
getDatabaseProductName SQLGetInfo fInfoType = SQL_DBMS_NAME
getDatabaseProductVersion SQLGetInfo fInfoType = SQL_DBMS_VER
usesLocalFiles SQLGetInfo fInfoType = SQL_FILE_USAGE; the result must be SQL_FILE_QUALIFIER
usesLocalFilePerTable SQLGetInfo fInfoType = SQL_FILE_USAGE; the result must be SQL_FILE_TABLE
supportsMixedCaseIdentifiers SQLGetInfo fInfoType = SQL_IDENTIFIER_CASE; the result must be SQL_IC_UPPER, SQL_IC_LOWER or SQL_IC_MIXED
storesUpperCaseIdentifiers SQLGetInfo fInfoType = SQL_IDENTIFIER_CASE, the result must be SQL_IC_UPPER
storesLowerCaseIdentifiers SQLGetInfo fInfoType = SQL_IDENTIFIER_CASE; the result must be SQL_IC_LOWER
storesMixedCaseIdentifiers SQLGetInfo fInfoType = SQL_IDENTIFIER_CASE; the result must be SQL_IC_MIXED
supportsMixedCaseQuoted
Identifiers
SQLGetInfo fInfoType = SQL_QUOTED_IDENTIFIER_CASE; the result must be SQL_IC_UPPER, SQL_IC_LOWER, or SQL_IC_MIXED
storesUpperCaseQuoted
Identifiers
SQLGetInfo fInfoType = SQL_QUOTED_IDENTIFIER_CASE; the result must be SQL_IC_UPPER
storesLowerCaseQuoted
Identifiers
SQLGetInfo fInfoType = SQL_QUOTED_IDENTIFIER_CASE; the result must be SQL_IC_LOWER
storesMixedCaseQuoted
Identifiers
SQLGetInfo fInfoType = SQL_QUOTED_IDENTIFIER_CASE; the result must be SQL_IC_MIXED
getIdentifierQuoteString SQLGetInfo fInfoType = SQL_IDENTIFIER_QUOTE_CHAR
getSQLKeywords SQLGetInfo fInfoType = SQL_KEYWORDS
getNumericFunctions SQLGetInfo fInfoType = SQL_NUMERIC_FUNCTIONS; the result is a bitmask enumerating the scalar numeric functions; this bitmask is used to create a comma-separated list of functions
getStringFunctions SQLGetInfo fInfoType = SQL_STRING_FUNCTIONS; the result is a bitmask enumerating the scalar string functions; this bitmask is used to create a comma-separated list of functions
getSystemFunctions SQLGetInfo fInfoType = SQL_SYSTEM_
FUNCTIONS; the result is a bitmask enumerating the scalar system functions; this bitmask is used to create a comma-separated list of functions
getTimeDateFunctions SQLGetInfo fInfoType = SQL_TIMEDATE_
FUNCTIONS; the result is a bitmask enumerating the scalar date and time functions; This bitmask is used to create a comma-separated list of functions
getSearchStringEscape SQLGetInfo fInfoType = SQL_SEARCH_PATTERN_
ESCAPE
getExtraNameCharacters SQLGetInfo fInfoType = SQL_SPECIAL_
CHARACTERS
supportsAlterTableWithAdd
Column
SQLGetInfo fInfoType = SQL_ALTER_TABLE; result must have the SQL_AT_ADD_COLUMN bit set
supportsAlterTableWithDrop
Column
SQLGetInfo fInfoType =SQL_ALTER_TABLE; the result must have the SQL_AT_DROP_
COLUMN bit set
supportsColumnAliasing SQLGetInfo fInfoType = SQL_COLUMN_ALIAS
nullPlusNonNullIsNull SQLGetInfo fInfoType = SQL_CONCAT_NULL_BEHAVIOR; the result must be SQL_CB_NULL
supportsConvert SQLGetInfo fInfoType = SQL_CONVERT_
FUNCTIONS; the result must be SQL_FN_CVT_CONVERT
supportsTableCorrelation
Names
SQLGetInfo fInfoType = SQL_CORRELATION_
NAME; the result must be SQL_CN_
DIFFERENT or SQL_CN_ANY
supportsDifferentTable
CorrelationNames
SQLGetInfo fInfoType = SQL_CORRELATION_
NAMES; the result must be SQL_CN_
DIFFERENT
supportsExpressionsIn
OrderBy
SQLGetInfo fInfoType = SQL_EXPRESSIONS_
IN_ORDER_BY
supportsOrderByUnrelated SQLGetInfo fInfoType = SQL_ORDER_BY_
COLUMNS_IN_SELECT
supportsGroupBy SQLGetInfo fInfoType = SQL_GROUP_BY; the result must not be SQL_GB_NOT_
SUPPORTED
supportsGroupByUnrelated SQLGetInfo fInfoType = SQL_GROUP_BY; the result must be SQL_GB_NO_
RELATION
supportsGroupByBeyond
Select
SQLGetInfo fInfoType = SQL_GROUP_BY; the result must be SQL_GB_GROUP_BY_
CONTAINS_SELECT
supportsLikeEscapeClause SQLGetInfo fInfoType = SQL_LIKE_ESCAPE_
CLAUSE
supportsMultipleResultSets SQLGetInfo fInfoType = SQL_MULT_RESULT_
SETS
supportsMultipleTransactions SQLGetInfo fInfoType = SQL_MULTIPLE_
ACTIVE_TXN
supportsNonNullableColumns SQLGetInfo fInfoType = SQL_NON_
NULLABLE_COLUMNS; the result must be SQL_NNC_NON_
NULL
supportsMinimumSQL
Grammar
SQLGetInfo fInfoType = SQL_ODBC_SQL_
CONFORMANCE; result must be SQL_OSC_MINIMUM, SQL_OSC_CORE, or SQL_OSC_EXTENDED
supportsCoreSQLGrammar SQLGetInfo fInfoType = SQL_ODBC_
SQL_CONFORMANCE; the result must be SQL_OSC_CORE or SQL_OSC_EXTENDED
supportsExtendedSQL
Grammar
SQLGetInfo fInfoType = SQL_ODBC_
SQL_CONFORMANCE; the result must be SQL_OSC_
EXTENDED
supportsIntegrityEnhancement
Facility
SQLGetInfo fInfoType = SQL_ODBC_SQL_
OPT_IEF
supportsOuterJoins SQLGetInfo fInfoType = SQL_OUTER_JOINS; the result must not be “N”
supportsFullOuterJoins SQLGetInfo fInfoType = SQL_OUTER_JOINS; the result must be “F”
supportsLimitedOuterJoins SQLGetInfo fInfoType = SQL_OUTER_JOINS; the result must be “P”
getSchemaTerm SQLGetInfo fInfoType = SQL_OWNER_TERM
getProcedureTerm SQLGetInfo fInfoType = SQL_PROCEDURE_TERM
getCatalogTerm SQLGetInfo fInfoType = SQL_QUALIFIER_TERM
isCatalogAtStart SQLGetInfo fInfoType = SQL_QUALIFIER_
LOCATION; the result must be SQL_QL_START
getCatalogSeparator SQLGetInfo fInfoType = SQL_QUALIFIER_NAME_
SEPARATOR
supportsSchemasInData
Manipulation
SQLGetInfo fInfoType = SQL_OWNER_USAGE; the result must have the SQL_OU_DML_
STATEMENTS bit set
supportsSchemasInProcedure
Calls
SQLGetInfo fInfoType = SQL_OWNER_USAGE; the result must have the SQL_OU_
PROCEDURE_INVOCATION bit set
supportsSchemasInTable
Definitions
SQLGetInfo fInfoType = SQL_OWNER_USAGE; the result must have the SQL_OU_TABLE_
DEFINITION bit set
supportsSchemasInIndex
Definitions
SQLGetInfo fInfoType = SQL_OWNER_USAGE; the result must have the SQL_OU_INDEX_
DEFINITION bit set
supportsSchemasInPrivilege
Definitions
SQLGetInfo fInfoType = SQL_OWNER_USAGE; the result must have the SQL_OU_
PRIVILEGE_DEFINITION bit set
supportsCatalogsInData
Manipulation
SQLGetInfo fInfoType = SQL_QUALIFIER_USAGE; the result must have the SQL_QU_DML_STATEMENTS bit set
supportsCatalogsInProcedure
Calls
SQLGetInfo fInfoType = SQL_QUALIFIER_USAGE; the result must have the SQL_QU_
PROCEDURE_INVOCATION bit set
supportsCatalogsInTable
Definitions
SQLGetInfo fInfoType = SQL_QUALIFIER_
USAGE; the result must have the SQL_QU_TABLE_DEFINITION bit set
supportsCatalogsInIndex
Definitions
SQLGetInfo fInfoType = SQL_QUALIFIER_USAGE; the result must have the SQL_QU_INDEX_DEFINITION bit set
supportsCatalogsInPrivilege
Definitions
SQLGetInfo fInfoType = SQL_QUALIFIER_USAGE; the result must have the SQL_QU_
PRIVILEGE_DEFINITION bit set
supportsPositionedDelete SQLGetInfo fInfoType = SQL_POSITIONED_
STATEMENTS; the result must have the SQL_PS_POSITIONED_DELETE bit set
supportsPositionedUpdate SQLGetInfo fInfoType = SQL_POSITIONED_
STATEMENTS; the result must have the SQL_PS_POSITIONED_UPDATE bit set
supportsSelectForUpdate SQLGetInfo fInfoType = SQL_POSITIONED_
STATEMENTS; the result must have the SQL_PS_SELECT_FOR_UPDATE bit set
supportsStoredProcedures SQLGetInfo fInfoType = SQL_PROCEDURES
supportsSubqueriesIn
Comparisons
SQLGetInfo fInfoType = SQL_SUBQUERIES; the result must have the SQL_SQ_
COMPARISON bit set
supportsSubqueriesInExists SQLGetInfo fInfoType = SQL_SUBQUERIES; the result must have the SQL_SQ_EXISTS bit set
supportsSubqueriesInIns SQLGetInfo fInfoType = SQL_SUBQUERIES; the result must have the SQL_SQ_IN bit set
supportsSubqueriesIn
Quantifieds
SQLGetInfo fInfoType = SQL_SUBQUERIES; the result must have the SQL_SQ_
QUANTIFIED bit set
supportsCorrelatedSubqueries SQLGetInfo fInfoType = SQL_SUBQUERIES; the result must have the SQL_SQ_
CORRELATED_SUBQUERIES bit set
supportsUnion SQLGetInfo fInfoType = SQL_UNION; the result must have the SQL_U_UNION bit set
supportsUnionAll SQLGetInfo fInfoType = SQL_UNION; the result must have the SQL_U_UNION_ALL bit set
supportsOpenCursors
Across Commit
SQLGetInfo fInfoType = SQL_CURSOR_COMMIT_
BEHAVIOR; the result must be SQL_CB_PRESERVE
supportsOpenCursors
Across Rollback
SQLGetInfo fInfoType = SQL_CURSOR_
ROLLBACK_BEHAVIOR; the result must be SQL_CB_PRESERVE
supportsOpenStatements
Across Commit
SQLGetInfo fInfoType = SQL_CURSOR_
COMMIT_BEHAVIOR; the result must be SQL_CB_PRESERVE or SQL_CB_CLOSE
supportsOpenStatements
Across Rollback
SQLGetInfo fInfoType = SQL_CURSOR_
ROLLBACK_BEHAVIOR; the result must be SQL_CB_PRESERVE or SQL_CB_CLOSE
getMaxBinaryLiteralLength SQLGetInfo fInfoType = SQL_MAX_BINARY_
LITERAL_LEN
getMaxCharLiteralLength SQLGetInfo fInfoType = SQL_MAX_CHAR_
LITERAL_LEN
getMaxColumnNameLength SQLGetInfo fInfoType = SQL_MAX_COLUMN_
NAME_LEN
getMaxColumnsInGroupBy SQLGetInfo fInfoType = SQL_MAX_COLUMNS_
IN_GROUP_BY
getMaxColumnsInIndex SQLGetInfo fInfoType = SQL_MAX_COLUMNS_
IN_INDEX
getMaxColumnsInOrderBy SQLGetInfo fInfoType = SQL_MAX_COLUMNS_
IN_ORDER_BY
getMaxColumnsInSelect SQLGetInfo fInfoType = SQL_MAX_COLUMNS_
IN_SELECT
getMaxColumnsInTable SQLGetInfo fInfoType = SQL_MAX_COLUMNS_
IN_TABLE
getMaxConnections SQLGetInfo fInfoType = SQL_ACTIVE_
CONNECTIONS
getMaxCursorNameLength SQLGetInfo fInfoType = SQL_MAX_CURSOR_
NAME_LEN
getMaxIndexLength SQLGetInfo fInfoType = SQL_MAX_INDEX_SIZE
getMaxSchemaNameLength SQLGetInfo fInfoType = SQL_MAX_OWNER_
NAME_LEN
getMaxProcedureNameLength SQLGetInfo fInfoType = SQL_MAX_
PROCEDURE_NAME_LEN
getMaxCatalogNameLength SQLGetInfo fInfoType = SQL_MAX_
QUALIFIER_NAME_LEN
getMaxRowSize SQLGetInfo fInfoType = SQL_MAX_ROW_SIZE
doesMaxRowSizeIncludeBlobs SQLGetInfo fInfoType = SQL_MAX_ROW_SIZE_
INCLUDES_LONG
getMaxStatementLength SQLGetInfo fInfoType = SQL_MAX_
STATEMENT_LEN
getMaxStatements SQLGetInfo fInfoType = SQL_ACTIVE_
STATEMENTS
getMaxTableNameLength SQLGetInfo fInfoType = SQL_MAX_TABLE_
NAME_LEN
getMaxTablesInSelect SQLGetInfo fInfoType = SQL_MAX_TABLES_
IN_SELECT
getMaxUserNameLength SQLGetInfo fInfoType = SQL_MAX_USER_
NAME_LEN
getDefaultTransactionIsolation SQLGetInfo fInfoType = SQL_DEFAULT_TXN_
ISOLATION
supportsTransactions SQLGetInfo fInfoType = SQL_TXN_CAPABLE; the result must not be SQL_TC_NONE
supportsTransactionIsolation
Level
SQLGetInfo fInfoType = SQL_TXN_ISOLATION_
OPTION
supportsDataDefinitionAnd
DataManipulationTransactions
SQLGetInfo fInfoType = SQL_TXN_CAPABLE; the result must have the SQL_TC_ALL bit set
supportsDataManipulation
TransactionsOnly
SQLGetInfo fInfoType = SQL_TXN_CAPABLE; the result must have the SQL_TC_DML bit set
dataDefinitionCauses
Transaction Commit
SQLGetInfo fInfoType = SQL_TXN_CAPABLE; the result must have the SQL_TC_DDL_COMMIT bit set
dataDefinition
IgnoredIn Transactions
SQLGetInfo fInfoType = SQL_TXN_CAPABLE; the result must have the SQL_TC_DDL_IGNORE bit set
getProcedures SQL
Procedures
Returns a list of procedure names
getProcedureColumns SQLProcedure Columns Returns a list of input and output parameters used for procedures
getTables SQLTables Returns a list of tables
getSchemas SQLTables Catalog = “”, Schema = “%”, Table = “”, TableType = NULL; only the TABLE_SCHEM column is returned
getCatalogs SQLTables Catalog = “%”, Schema = “”, Table = “”, TableType = NULL; only the TABLE_CAT column is returned
getTableTypes SQLTables Catalog = “”, Schema = “”, Table = “”, TableType = “%”
getColumns SQLColumns Returns a list of column names in specified tables
getColumnPrivileges SQLColumn Privileges Returns a list of columns and associated privileges for the specified table
getTablePrivileges SQLTable Privileges Returns a list of tables and the privileges associated with each table
getBestRowIdentifier SQLSpecial Columns fColType = SQL_BEST_ROWID
getVersionColumns SQLSpecial Columns fColType = SQL_ROWVER
getPrimaryKeys SQLPrimary
Keys
Returns a list of column names that comprise the primary key for a table
getImportedKeys SQLForeign
Keys
PKTableCatalog = NULL, PKTableSchema = NULL, PKTableName = NULL
getExportedKeys SQLForeign
Keys
FKTableCatalog = NULL, FKTableSchema = NULL, FKTableName = NULL
getCrossReference SQLForeign
Keys
Returns a list of foreign keys in the specified table
getTypeInfo SQLGetType
Info
fSqlType = SQL_ALL_TYPES
getIndexInfo SQLStatistics Returns a list of statistics about the specified table and the indexes associated with the table


Previous Table of Contents Next